// import component from 'virtual:svg-icons-register';

// 常量路由
export const constantRoute = [
    // 默认页
    {
        path: '/',
        component: () => import('@/views/login/index.vue'),
        redirect: '/login',
        meta: {
            title: "登录",//菜单标题
            hidden: true,//代表是否在菜单中隐藏
            icon: '',//菜单左侧的图标
        },
    },
    {
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',//命名路由
        meta: {
            title: "登录",//菜单标题
            hidden: true,//代表是否在菜单中隐藏
            icon: '',//菜单左侧的图标
        },
    },
    {
        path: '/register',
        component: () => import('@/views/register/index.vue'),
        name: 'register',//命名路由
        meta: {
            title: "注册",//菜单标题
            hidden: true,//代表是否在菜单中隐藏
            icon: '',//菜单左侧的图标
        },
    },
    // 首页
    {
        path: '/home',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        meta: {
            requiresAuth: true,
            title: "首页",//菜单标题
            hidden: false,//代表是否在菜单中隐藏
            icon: 'HomeFilled',//菜单左侧的图标
        },
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: "首页",//菜单标题
                    hidden: false,//代表是否在菜单中隐藏
                    icon: 'HomeFilled',//菜单左侧的图标
                }
            }
        ]
    },
    // TODO 测试任务
    {
        path:'/experiment',
        component:()=>import('@/layout/index.vue'),
        name: 'Experi',
        meta: {
            requiresAuth: true,
            title: '测试任务',
            hidden: false,
            icon: 'Lock',
        },
        redirect: '/experiment/user',
        children: [
            {
                path:'/experiment/user',
                component:()=>import('@/views/experiment/users/index.vue'),
                name:'Users',
                meta:{
                    title:'测试管理',
                    icon:'User',
                    hidden:false
                }
            },
            {
                path:'/experiment/project',
                component:()=>import('@/views/experiment/projects/index.vue'),
                name:'Projects',
                meta:{
                    title:'项目管理',
                    icon:'UserFilled',
                    hidden:false
                }
            },
            {
                path:'/experiment/cases',
                component:()=>import('@/views/experiment/cases/index.vue'),
                name:'Cases',
                meta:{
                    title:'测试用例管理',
                    icon:'Baseball',
                    hidden:false
                }
            },
            {
                path:'/experiment/file',
                component:()=>import('@/views/experiment/files/index.vue'),
                name:'Files',
                meta:{
                    title:'文件管理',
                    icon:'FolderOpened',
                    hidden:false
                }
            },
            {
                path:'/experiment/note',
                component:()=>import('@/views/experiment/notes/index.vue'),
                name:'Notes',
                meta:{
                    title:'笔记管理',
                    icon:'Notebook',
                    hidden:false
                }
            },
            {
                path:'/experiment/demand',
                component:()=>import('@/views/experiment/demands/index.vue'),
                name:'Demands',
                meta:{
                    title:'需求管理',
                    icon:'ChatSquare',
                    hidden:false
                }
            },
            {
                path:'/experiment/bugs',
                component:()=>import('@/views/experiment/bugs/index.vue'),
                name:'Bugs',
                meta:{
                    title:'BUG管理',
                    icon:'ChatSquare',
                    hidden:false
                },
            },
            {
                path:'/experiment/bugs/:id',
                component:()=>import('@/views/experiment/bugs/bugList/index.vue'),
                name:'BugsList',
                meta:{
                    title:'BUG管理 / BUG列表',
                    icon:'ChatSquare',
                    hidden:true
                }
            },
            /* {
                path:'/experiment/bugs/addRequirementBug/:id',
                component:()=>import('@/views/experiment/bugs/index.vue'),
                name:'AddBug',
                meta:{
                    title:'BUG管理 / 添加BUG',
                    icon:'ChatSquare',
                    hidden:true
                }
            }, */
            {
                path:'/experiment/wiki',
                component:()=>import('@/views/experiment/wiki/index.vue'),
                name:'WIKI',
                meta:{
                    title:'wiki管理',
                    icon:'Reading',
                    hidden:false
                }
            },
        ]
    },
    // TODO 研发任务
    {
        path:'/requirement',
        component:()=>import('@/layout/index.vue'),
        name: 'Require',
        meta: {
            requiresAuth: true,
            title: '研发任务',
            hidden: false,
            icon: 'Platform',
        },
        redirect: '/requirement/create',
        children: [
            {
                path:'/requirement/create',
                component:()=>import('@/views/requirement/createRequirement/index.vue'),
                name:'Create',
                meta:{
                    title:'创建需求',
                    icon:'FolderAdd',
                    hidden:false
                }
            },
            {
                path:'/requirement/userCreate',
                component:()=>import('@/views/requirement/userCreateRequirement/index.vue'),
                name:'userCreate',
                meta:{
                    title:'我创建的需求',
                    icon:'Stamp',
                    hidden:false
                }
            },
            {
                path:'/requirement/userReview',
                component:()=>import('@/views/requirement/userReviewRequirement/index.vue'),
                name:'userReview',
                meta:{
                    title:'我待审核的需求',
                    icon:'Bell',
                    hidden:false
                }
            },
            {
                path:'/requirement/distribute',
                component:()=>import('@/views/requirement/avgRequirement/index.vue'),
                name:'Distribute',
                meta:{
                    title:'我负责的需求',
                    icon:'Files',
                    hidden:false
                }
            },
            {
                path:'/requirement/noTipRequirement',
                component:()=>import('@/views/requirement/noTipRequirement/index.vue'),
                name:'noTipRequirement',
                meta:{
                    title:'详细设计待审核',
                    icon:'School',
                    hidden:false
                }
            },
            {
                path:'/requirement/research',
                component:()=>import('@/views/requirement/researchRequirement/index.vue'),
                name:'Research',
                meta:{
                    title:'我负责的任务',
                    icon:'DataLine',
                    hidden:false
                }
            },
            {
                path:'/requirement/onlineReview',
                component:()=>import('@/views/requirement/onlineReviewRequirement/index.vue'),
                name:'OnlineReview',
                meta:{
                    title:'待上线评审需求',
                    icon:'Position',
                    hidden:false
                }
            },
            {
                path:'/requirement/onlineTasks',
                component:()=>import('@/views/requirement/onlineTasksRequirement/index.vue'),
                name:'onlineTasks',
                meta:{
                    title:'我的上线任务',
                    icon:'Reading',
                    hidden:false
                }
            },
        ]
    },
    // 404
    {
        path: "/404",
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: "404",//菜单标题
            hidden: true,//代表是否在菜单中隐藏
            icon: 'Promotion',//菜单左侧的图标
        }
    },
    // 其余路由到404页面
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'Any',
        meta: {
            title: "任意路由",//菜单标题
            hidden: true,//代表是否在菜单中隐藏
            icon: 'Promotion',//菜单左侧的图标
        }
    }
];